unit uMain;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
  FMX.Layouts, FMX.ListView.Types, FireDAC.Stan.Intf, FireDAC.Stan.Option,
  FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf,
  FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, Data.DB,
  FireDAC.Comp.DataSet, FireDAC.Comp.Client, FMX.ListView, System.Rtti,
  System.Bindings.Outputs, Fmx.Bind.Editors, Data.Bind.EngExt,
  Fmx.Bind.DBEngExt, Data.Bind.Components, Data.Bind.DBScope;

type
  TfrmMain = class(TForm)
    Layout1: TLayout;
    Layout2: TLayout;
    Layout3: TLayout;
    Layout4: TLayout;
    Layout5: TLayout;
    Button1: TButton;
    Layout8: TLayout;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Layout6: TLayout;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMain: TfrmMain;

implementation

{$R *.fmx}

uses uLogin, uModule, uOrders;

procedure TfrmMain.Button1Click(Sender: TObject);
begin
  frmLogin := TfrmLogin.Create(nil);
  frmLogin.Show;
end;

procedure TfrmMain.Button2Click(Sender: TObject);
begin
  frmOrders := TfrmOrders.Create(nil);
  frmOrders.Show;
end;

procedure TfrmMain.FormActivate(Sender: TObject);
begin
  if UserConnected = '' then
  Begin
    Layout2.Visible := True;
  End
  Else
  Begin
    Layout2.Visible := False;
    Label1.Text := UserConnected;
  End;
end;

end.
